// 导入RouterView
import RouterView from './router/index.jsx'
import {useEffect} from 'react'
// NavLink导航链接，HashRouter哈希路由
import {NavLink,HashRouter} from 'react-router-dom'
export default function App(){
	useEffect(()=>{
		fetch("/mi/list.php?channel_id=hot")
		.then(res=>res.json())
		.then(res=>{
			console.log(res);
		})
	},[])
// 使用HashRouter包括所有
	return <HashRouter>
			<NavLink to="/">首页</NavLink> | 
			<NavLink to="/about">关于</NavLink>| 
			<NavLink to="/product/abc">产品abc</NavLink> | 
			<NavLink to="/product/456">产品456</NavLink>| 
			<NavLink to="/about?redirect=hello">参数hello</NavLink>| 
			<NavLink to="/about?redirect=world">参数world</NavLink>| 
			<NavLink to='/admin'>管理</NavLink>
			<RouterView/>
	</HashRouter>	
}